/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.noah.service;

import com.noah.model.RoleModel;
import com.noah.rowmapper.RoleRowMapper;
import java.util.List;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 *
 * @author ngoc.phan
 */
public class RoleService {
    private JdbcTemplate jdbcTemplate;

    /**
     * @return the jdbcTemplate
     */
    public JdbcTemplate getJdbcTemplate() {
        return jdbcTemplate;
    }

    /**
     * @param jdbcTemplate the jdbcTemplate to set
     */
    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }
    public List<RoleModel> getRoles(){
        String sql = "Select * from role";
        return getJdbcTemplate().query(sql,new RoleRowMapper());
    }
}
